package com.jic.order.controller.rest;

import com.jic.common.base.vo.RestResult;
import com.jic.order.entity.OrderOutStockNotice;
import com.jic.order.service.OrderOutStockNoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api(tags = "API-无货提醒单")
@RequestMapping(value = "orderOutStockNotice")
@RestController
public class OrderOutStockNoticeRest {

    @Autowired
    private OrderOutStockNoticeService orderOutStockNoticeService;

    @ApiOperation(value = "创建无货提醒")
    @PostMapping(value = "createOrderOutStockNotice")
    public RestResult<String> createOrderOutStockNotice(@RequestBody OrderOutStockNotice form) {
        return RestResult.success(orderOutStockNoticeService.insert(form) > 0 ? "成功" : "失败");
    }
}
